package me.zk.practice1.s;

/**
 * @author zhangkai
 * @date 2023/7/7 17:16
 */
public class LS206 {

    public ListNode reverseList(ListNode head) {
        ListNode pre = null,cur = head;

        while (cur!=null){
            ListNode temp = cur.next;
            cur.next = pre;
            pre = cur;
            cur = temp;
        }
        return pre;

    }
}
